import store from '@/store'
import request from '@/utils/axios'

// 预警通知列表
export function getWarningList(data) {
  return request.post({
    url: '/eprofile-web/api/early/warning/page',
    data
  })
}

// 预警通知新增
export function warningAdd(data) {
  return request.post({
    url: '/eprofile-web/api/early/warning/save',
    data
  })
}

// 预警通知删除
export function warningDel(id) {
  return request.get({
    url: `/eprofile-web/api/early/warning/delete/${id}`
  })
}

// 管理模板列表
export function getWarningTemplates() {
  return request.post({
    url: `/eprofile-web/api/manage/plan/template-info`,
    data: {
      templateType: '预警通知',
      platformId: store.userStore.platformId,
      templateAffiliation: null
    }
  })
}

// 模板详情
export function warningInfo(id) {
  return request.get({
    url: `/eprofile-web/api/early/warning/info/${id}`
  })
}
